<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script type="text/javascript">
<!--
$(function(){
	//初始化表单验证
	$("#editForm").validate({
		messages:{
			aname: {required: "请输入姓名"},
			phone: {required: "请输入电话"}
		},
		submitHandler:function(form){
			$(form).ajaxSubmit({
				success:function(data){
					switch(data.flag){
					case -1:
						Kit.alert("网络繁忙...，请重试");return;
					case 0:
						dataPaginator.loadPage(1);
						editDialog.close();
					}
				}
			});
		}
	});
});
//-->
</script>
<form id="editForm" action="${BASE_PATH}/sys/sms/doEdit" method="post" class="form-horizontal">
	<div class="form-group">
	    <label class="col-lg-2 control-label">姓名</label>
	    <div class="col-lg-9">
        	<input type="text" name="aname" value="${object.name}" class="form-control" placeholder="请输入姓名" >
	    </div>
	</div>
	<div class="form-group">
	    <label class="col-lg-2 control-label">类型</label>
	    <div class="col-lg-9">
        	<select name="type" class="selectpicker form-control" required>
				<c:choose>
	        		<c:when test="${RoleId==1 }">
	        			<option value="1">全部</option>
						<option value="2">常规</option>
						<option value="3">团购</option>
	        		</c:when>
	        		<c:when test="${RoleId==2 }">
	        			<option value="4">商家</option>
	        		</c:when>
	        		<c:when test="${RoleId==3 }">
	        			<option value="5">分公司</option>
	        		</c:when>
	        		<c:otherwise>
	        			<option value="6">店员</option>
	        		</c:otherwise>
	        	</c:choose>
	        </select>
	    </div>
	    <input type="hidden" name="RoleId" value="${RoleId }" class="form-control" readonly="readonly">
	</div>
	  	<c:if test="${RoleId==2 }">
		<div class="form-group">
		    <label class="col-lg-2 control-label">所属商家</label>
		    <div class="col-lg-9">
	        	<input type="text" name="sellername" value="${record.sellerName }" class="form-control" readonly="readonly">
	        	<input type="hidden" name="sellerid" value="${record.id }" class="form-control" readonly="readonly">
		    </div>
		</div>
   	</c:if>
   	<c:if test="${RoleId==3 }">
		<div class="form-group">
		    <label class="col-lg-2 control-label">所属分公司</label>
		    <div class="col-lg-9">
	        	<input type="text" name="storename" value="${record.title }" class="form-control" readonly="readonly">
	        	<input type="hidden" name="storeid" value="${record.id }" class="form-control" readonly="readonly">
	        	<input type="hidden" name="sellerids" value="${record.sellerid }" class="form-control" readonly="readonly">
		    </div>
		</div>
   	</c:if>
	<div class="form-group">
	    <label class="col-lg-2 control-label">电话</label>
	    <div class="col-lg-9">
        	<input type="text" name="phone" value="${object.phone}" class="form-control" placeholder="请输入电话" required maxlength="11">
	    </div>
	</div>
	<div class="row">
		<div class="col-lg-6"><button class="btn btn-primary col-sm-3 pull-right" type="submit" autocomplete="off">提交</button></div>
		<div class="col-lg-6"><button class="btn btn-default col-sm-3 pull-left" type="button" onclick="javascript:editDialog.close();" autocomplete="off">取消</button></div>
	</div>
	<input type="hidden" name="smsid" value="${object.id}"/>
</form>